
  	move(state([X1,X2,X3,X4,0,X6,X7,X8,X9]), state([X1,0,X3,X4,X2,X6,X7,X8,X9])).
  	move(state([X1,X2,X3,X4,0,X6,X7,X8,X9]), state([X1,X2,X3,0,X4,X6,X7,X8,X9])).
   	move(state([X1,X2,X3,X4,0,X6,X7,X8,X9]), state([X1,X2,X3,X4,X6,0,X7,X8,X9])).
	move(state([X1,X2,X3,X4,0,X6,X7,X8,X9]), state([X1,X2,X3,X4,X8,X6,X7,0,X9])).
	
	move(state([0,X2,X3,X4,X5,X6,X7,X8,X9]), state([X2,0,X3,X4,X5,X6,X7,X8,X9])).
	move(state([0,X2,X3,X4,X5,X6,X7,X8,X9]), state([X4,X2,X3,0,X5,X6,X7,X8,X9])).
	
	move(state([X1,0,X3,X4,X5,X6,X7,X8,X9]), state([0,X1,X3,X4,X5,X6,X7,X8,X9])).
	move(state([X1,0,X3,X4,X5,X6,X7,X8,X9]), state([X1,X3,0,X4,X5,X6,X7,X8,X9])).
	move(state([X1,0,X3,X4,X5,X6,X7,X8,X9]), state([X1,X5,X3,X4,0,X6,X7,X8,X9])).
	
	move(state([X1,X2,0,X4,X5,X6,X7,X8,X9]), state([X1,0,X2,X4,X5,X6,X7,X8,X9])).
	move(state([X1,X2,0,X4,X5,X6,X7,X8,X9]), state([X1,X2,X6,X4,X5,0,X7,X8,X9])).
	
	move(state([X1,X2,X3,0,X5,X6,X7,X8,X9]), state([0,X2,X3,X1,X5,X6,X7,X8,X9])).
	move(state([X1,X2,X3,0,X5,X6,X7,X8,X9]), state([X1,X2,X3,X5,0,X6,X7,X8,X9])).
	move(state([X1,X2,X3,0,X5,X6,X7,X8,X9]), state([X1,X2,X3,X7,X5,X6,0,X8,X9])).
	
	move(state([X1,X2,X3,X4,X5,0,X7,X8,X9]), state([X1,X2,0,X4,X5,X3,X7,X8,X9])).
	move(state([X1,X2,X3,X4,X5,0,X7,X8,X9]), state([X1,X2,X3,X4,0,X5,X7,X8,X9])).
	move(state([X1,X2,X3,X4,X5,0,X7,X8,X9]), state([X1,X2,X3,X4,X5,X9,X7,X8,0])).
	
	move(state([X1,X2,X3,X4,X5,X6,0,X8,X9]), state([X1,X2,X3,0,X5,X6,X4,X8,X9])).
	move(state([X1,X2,X3,X4,X5,X6,0,X8,X9]), state([X1,X2,X3,X4,X5,X6,X8,0,X9])).
	
	move(state([X1,X2,X3,X4,X5,X6,X7,0,X9]), state([X1,X2,X3,X4,X5,X6,X7,X9,0])).
	move(state([X1,X2,X3,X4,X5,X6,X7,0,X9]), state([X1,X2,X3,X4,0,X6,X7,X5,X9])).
	move(state([X1,X2,X3,X4,X5,X6,X7,0,X9]), state([X1,X2,X3,X4,X5,X6,0,X7,X9])).
	
    move(state([X1,X2,X3,X4,X5,X6,X7,X8,0]), state([X1,X2,X3,X4,X5,0,X7,X8,X6])).
    move(state([X1,X2,X3,X4,X5,X6,X7,X8,0]), state([X1,X2,X3,X4,X5,X6,X7,0,X8])).  	     	  


	algorithm(dfs). /*dfs or brfs*/

	mywrite(state([X1,X2,X3,X4,X5,X6,X7,X8,X9])):-
		write(X1), write(X2), write(X3), nl,
		write(X4), write(X5), write(X6), nl,
		write(X7), write(X8), write(X9), nl.
  


	go_p(state([1,2,3,8,0,4,7,6,5])).

	isGoal(state([1,2,3,7,8,4,6,0,5])).
